package com.ruoyi.game.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.game.domain.GameRound;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.game.mapper.GameRoundMapper;
import com.ruoyi.game.service.IGameRoundService;

/**
 * 回合Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-18
 */
@Service
public class GameRoundServiceImpl implements IGameRoundService 
{
    @Autowired
    private GameRoundMapper gameRoundMapper;

    /**
     * 查询回合
     * 
     * @param id 回合主键
     * @return 回合
     */
    @Override
    public GameRound selectGameRoundById(Long id)
    {
        return gameRoundMapper.selectGameRoundById(id);
    }

    /**
     * 查询回合列表
     * 
     * @param gameRound 回合
     * @return 回合
     */
    @Override
    public List<GameRound> selectGameRoundList(GameRound gameRound)
    {
        return gameRoundMapper.selectGameRoundList(gameRound);
    }

    /**
     * 新增回合
     * 
     * @param gameRound 回合
     * @return 结果
     */
    @Override
    public int insertGameRound(GameRound gameRound)
    {
        gameRound.setCreateTime(DateUtils.getNowDate());
        return gameRoundMapper.insertGameRound(gameRound);
    }

    /**
     * 修改回合
     * 
     * @param gameRound 回合
     * @return 结果
     */
    @Override
    public int updateGameRound(GameRound gameRound)
    {
        gameRound.setUpdateTime(DateUtils.getNowDate());
        return gameRoundMapper.updateGameRound(gameRound);
    }

    /**
     * 批量删除回合
     * 
     * @param ids 需要删除的回合主键
     * @return 结果
     */
    @Override
    public int deleteGameRoundByIds(Long[] ids)
    {
        return gameRoundMapper.deleteGameRoundByIds(ids);
    }

    /**
     * 删除回合信息
     * 
     * @param id 回合主键
     * @return 结果
     */
    @Override
    public int deleteGameRoundById(Long id)
    {
        return gameRoundMapper.deleteGameRoundById(id);
    }
}
